<?php

Raise::load('core.RaiseMime');

/**
 * TestCoreRaiseMime class
 * Testing unit of 'phpraise/core/RaiseMime.php'
 *
 * @author Sam-Mauris Yong <hellclanner at live dot com>
 * @license http://www.opensource.org/licenses/bsd-license New BSD License
 * @package Raise.UnitTest.Test
 */
class TestCoreRaiseMime extends RaiseTest {

    public static function testClass(){
        self::assertClassExists('RaiseMime');
        self::assertClassExtends('RaiseMime', 'RaiseStaticClass');
        self::assertClassMethod('RaiseMime', array('mime', 'extension'));
    }
    
    public static function testTranslate(){
        self::assertObjectClass(RaiseMime::extension('application/x-httpd-php'), 'RaiseCollection');
        self::assertObjectClass(RaiseMime::mime('php'), 'RaiseCollection');

        self::assertTrue(RaiseMime::extension('application/x-httpd-php')->valueExists('php'));
        self::assertTrue(RaiseMime::mime('php')->valueExists('application/x-httpd-php'));
        self::assertTrue(RaiseMime::extension('text/css')->valueExists('css'));
        self::assertTrue(RaiseMime::mime('css')->valueExists('text/css'));

        self::assertTrue(RaiseMime::mime('dll')->valueExists('application/octet-stream'));
        self::assertTrue(RaiseMime::extension('application/octet-stream')->valueExists('exe'));
        self::assertTrue(RaiseMime::extension('application/octet-stream')->valueExists('dll'));
    }

}

